home *** CD-ROM | disk | FTP | other *** search
/ UpTime Volume 1 #6 / utv1n6s1.d64 / wall street wiz (.txt) < prev    next >
Commodore BASIC  |  2022-08-28  |  9KB  |  302 lines

  1. 0 ifa=0thena=1:load"0:wiz.ml",8,1
  2. 5 poke55,0:poke56,128:clr
  3. 10 rem(c)1987 uptime by softdisk publishing, inc
  4. 11 print"[147]":clr
  5. 13 sys52945
  6. 15 poke53280,0:poke53281,0:poke54273,25:poke54277,9:poke54278,9:poke54296,15
  7. 16 poke54280,10:poke54284,2:poke54285,0:poke54275,8
  8. 20 print"[147]":clr
  9. 60 esc=0:mt=0
  10. 70 dimtc(30),ts(30),tp(30),sp(30,7),dj(30)
  11. 75 dimsn(30,7),chg(30,7),chg$(30,7),nm$(30,7)
  12. 80 tc(0)=1000000: dj(0)=2000
  13. 90 rem
  14. 95 a$="[215]all [211]treet [215]iz"
  15. 100 cn$(1)="[203][194][205]":hp$(1)=" 14":lp$(1)="  4"
  16. 105 sp(0,1)=9:ep$(1)="  .01":vg(1)=2:vb(1)=3
  17. 110 cn$(2)="[197][216][216][207][198][198]":hp$(2)=" 59":lp$(2)=" 43"
  18. 115 sp(0,2)=55:ep$(2)=" 2.50":vg(2)=2:vb(2)=4
  19. 120 cn$(3)="[213][194][205]":hp$(3)="150":lp$(3)=" 90":sp(0,3)=105
  20. 125 ep$(3)="10.00":vg(3)=2:vb(3)=5
  21. 130 cn$(4)="[215]izer":hp$(4)=" 70":lp$(4)=" 21"
  22. 135 sp(0,4)=60:ep$(4)=" 8.00":vg(4)=2:vb(4)=2.5
  23. 140 cn$(5)="[207]n[212]rax":hp$(5)=" 39":lp$(5)=" 14"
  24. 145 sp(0,5)=19:ep$(5)="  -0-":vg(5)=5:vb(5)=2.4
  25. 150 cn$(6)="[205]icro[195]hip":hp$(6)="  9":lp$(6)="  3":sp(0,6)=7
  26. 155 ep$(6)="  -0-":vg(6)=2:vb(6)=2
  27. 160 cn$(7)="[204]azer [195]orp.":hp$(7)=" 20":lp$(7)="  2"
  28. 165 sp(0,7)=10:ep$(7)=" 1.00":vg(7)=2:vb(7)=2.4
  29. 170 rem
  30. 180 mt=0:gosub920
  31. 190 d=0:nc=7:gosub1200
  32. 200 poke214,14:print"[145]":print"[200]ere is a list of stocks with the"
  33. 202 print"year's [200]igh, [204]ow, and [195]urrent prices"
  34. 205 print"and [197]arnings per [211]hare:"
  35. 210 getsh$:ifsh$=""then210
  36. 220 ifsh$=chr$(13)thengoto250
  37. 230 ifsh$="[140]"then goto 900
  38. 240 poke54276,33:poke54276,32: goto 210
  39. 250 rem
  40. 260 gosub 1400: rem  subr to buy stocks
  41. 270 rem
  42. 280 mt=2:gosub920
  43. 290 poke214,6:print"[145]":print"[212]he duration of this session of [215][193][204][204]"
  44. 292 print"[211][212][210][197][197][212] [215][201][218] is measured in days."
  45. 294 poke214,18:print"[145]":m$="[197]nter zero (0) and [[210][197][212][213][210][206]] to exit":gosub1040
  46. 300 poke214,10:print:print"[197]nter number of days (1 to 30) you'll"
  47. 302 print"be investing & press [return] -> ";:bs=1:gosub1700:dm$=wq$
  48. 304 dm=val(dm$+chr$(0)):ifasc(dm$+chr$(0))=48then:goto900
  49. 310 ifdm$=" "then290
  50. 320 if(dm<1)or(dm>30)thengosub1150:sl=21:nl=1:gosub1170:goto290
  51. 330 print"[147]":m$="[208]lease wait....."
  52. 332 gosub1040:print:m$="[212]he [215][193][204][204] [211][212][210][197][197][212] computer is working"
  53. 334 gosub1040:print:m$="on your portfolio.":gosub1040
  54. 340 ford=1todm:tc(d)=tc(d-1):ifdur>0then370
  55. 350 rn=int(1+rnd(1)*10):ifrn>4thendur=rn:goto370
  56. 360 dur=rn+6
  57. 370 dj(d)=int(dj(d-1)*(-(rn>4)*.995-(rn<5)*1.01)+10*rnd(1)-5)
  58. 375 dd=dj(d)-dj(d-1):dur=dur-1
  59. 376 forxx=1to2
  60. 377 rx(xx)=int(7*rnd(1)+1)
  61. 380 if rx(2)=rx(1)thenxx=1
  62. 390 next
  63. 400 forc=1to7:ifc=rx(1)then430
  64. 410 ifc=rx(2)then430
  65. 420 goto450
  66. 430 sn(d,c)=int(2*rnd(1)):ifsn(d,c)=0thengosub1310:goto450
  67. 440 gosub1350
  68. 450 ifsp(d-1,c)>=10then460
  69. 452 sp(d,c)=int(sp(d-1,c)*(-1.3*(dd>0)-.98*(dd<1))+(nv(c)*.5)):goto480
  70. 460 ifsp(d-1,c)<=50thengoto470
  71. 462 sp(d,c)=int(sp(d-1,c)*(-1.02*(dd>0)-.99*(dd<1))+(nv(c)*.7)):goto480
  72. 470 sp(d,c)=int(sp(d-1,c)*(-1.03*(dd>0)-.98*(dd<1))+(nv(c)*.6))
  73. 480 ifsp(d,c)<0thensp(d,c)=0
  74. 490 chg(d,c)=sp(d,c)-sp((d-1),c)
  75. 495 ifchg(d,c)<1thenchg$(d,c)=str$(chg(d,c)):goto 510
  76. 500 chg$(d,c)="+"+str$(chg(d,c)):goto520
  77. 510 if(sp((d-1),c)=0)and(chg(d,c)<0)thenchg$(d,c)="0"
  78. 520 next
  79. 530 rem
  80. 540 mt=1:gosub 920
  81. 545 print"[146]# [195]ompany [206]ame  [208]/[211]  [195]hg #[211]hrs  [212]ot [214]al"
  82. 546 tv=0:forc=1to7
  83. 550 poke214,c+3:print"[145]":printc;tab(3);
  84. 555 print"[129]"cn$(c);:h=20:a=sp(d,c):gosub1060:print"[158]"a;
  85. 557 hx=len(chg$(d,c)):printtab(25-hx)"[159]"chg$(d,c);
  86. 559 ifns(c)<1then570
  87. 560 hx=len(ns$(c)):printtab(31-hx);
  88. 565 print"[156]"ns$(c);:tv(c)=ns(c)*sp(d,c):h=39:a=tv(c):gosub1060:print""a
  89. 567 tv=tv+tv(c)
  90. 570 nextc:poke214,10:print:printtab(31)"[192][192][192][192][192][192][192]":printtab(16)"[159][196]ay #";d
  91. 572 printtab(11)"[212]otal [211]tock [214]alue =";:h=39:a=tv
  92. 575 gosub1060:printa
  93. 580 printtab(13)"[193]vailable  [195]ash =";
  94. 585 h=39:a=tc(d):gosub1060:printa
  95. 587 ifcom>0thenprinttab(11)"[211]tock commissions =";:a=com:h=39:gosub1060:printa
  96. 590 printtab(7)"[153][212]otal [208]ortfolio [214]alue =";
  97. 595 bl=tc(d)+tv:h=39:a=bl:gosub1060:printa
  98. 605 dj$="[196]ow-[202]ones [193]vg"+str$(dj(d))+"-":dd$="[206]o [195]hg"
  99. 607 print"[154]":m$="[215]all [211]t. [206]ews:  ":gosub1040
  100. 610 ifdd>0thendd$="[213]p"+str$(dd):goto630
  101. 620 ifdd<0thendd$="[196]n"+str$(abs(dd))
  102. 630 dj$=dj$+dd$:m$=dj$:uy=19-len(m$)/2:forl=1touy:m$=m$+" ":next:gosub1130
  103. 640 nm$="":r=0:forn=1to7:iflen(nm$(d,n))=0thengoto680
  104. 650 nm$=cn$(n)+nm$(d,n):r=r+1
  105. 660 iflen(nm$)<38thenforw=1to38-len(nm$):nm$=nm$+".":next
  106. 670 m$=nm$:gosub1140
  107. 680 next
  108. 690 getqw$:ifqw$=""then 690
  109. 700 ifqw$=chr$(13)then800
  110. 710 ifqw$="[140]"then900
  111. 720 ifqw$="b"orqw$="[194]"then750
  112. 730 ifqw$="s"orqw$="[211]"then770
  113. 734 ifqw$="o"orqw$="[207]"thenpoke54276,65:poke54276,64
  114. 735 if(qw$="o"orqw$="[207]")andsf=1thenpoke781,23:poke782,36:poke783,48
  115. 736 if(qw$="o"orqw$="[207]")andsf=1thensf=0:sys65520:print"[149]n [146]";:goto690
  116. 737 if(qw$="o"orqw$="[207]")andsf=0thenpoke781,23:poke782,36:poke783,48
  117. 738 if(qw$="o"orqw$="[207]")andsf=0thensf=1:sys65520:print"[149]ff[146]";:goto690
  118. 740 poke54276,65:poke54276,64:goto690
  119. 750 rem
  120. 760 gosub1400:goto530
  121. 770 rem
  122. 780 gosub1540:goto530
  123. 790 sl=16:nl=5:gosub1170:gosub4800:gosub1540:goto530
  124. 800 com=0:nextd
  125. 810 rem
  126. 820 mt=2:gosub920:print:m$="[159][201][206][214][197][211][212][205][197][206][212] [211][197][211][211][201][207][206] [210][197][208][207][210][212]"
  127. 822 gosub1040:print"[195]lient's final portfolio    [153]$";
  128. 824 h=39:a=bl:gosub1060:printbl
  129. 826 print"[195]lient's initial investment [150]$";:h=39:a=1000000:gosub1060:printa
  130. 830 printtab(31)"[192][192][192][192][192][192][192]"
  131. 832 print"[206]et gain or loss(-)[154]";
  132. 834 h=39:a=bl-1000000:gosub1060:printa
  133. 835 print"[158]";
  134. 840 if(a<-10000)or(a>10000)thengoto850
  135. 845 print"  [217]our client expected better results!":goto890
  136. 850 if(a<-10000)or(a>100000)then860
  137. 855 print" [199][207][207][196] [202][207][194]! [217]ou get a raise of $10,000!":goto890
  138. 860 ifa<-10000then870
  139. 865 print" [211][213][208][197][210]!!! [217]ou've been promoted to [214][208]!!":goto890
  140. 870 ifa<-100000then880
  141. 875 print"   [206][207][212] [212][207][207] [199][207][207][196]! [217]our boss is mad!!!!":goto890
  142. 880 print"       [217]ou could lose your job!!!"
  143. 890 print"":m$="[196]o you want to invest again?":gosub1040
  144. 892 print"       [197]nter [217] or [206] --> [166][157]";:gosub1080
  145. 894 poke204,255:printan$:ifan$="y"oran$="[217]"then20
  146. 900 rem
  147. 910 ifpeek(32768)=76andpeek(32769)=7andpeek(32770)=128andpeek(32771)=234then914
  148. 912 print"[147]":new
  149. 914 ifpeek(32772)<>76orpeek(32774)<>128then912
  150. 916 sys32772
  151. 920 rem
  152. 940 print"[147][149]$$$$$$$$$$$[146]";
  153. 942 printtab(11)" ";a$;" ";
  154. 944 printtab(29)"$$$$$$$$$$$[146]"
  155. 950 ifmt=1then990
  156. 960 ifmt=2then1010
  157. 970 ifmt=3then1000
  158. 980 poke214,24:print"[145]":print" [[198]8] to end";
  159. 985 print"       [[210][197][212][213][210][206]] to continue[146]";:poke2023,160:poke56295,9:goto1010
  160. 990 sf$="n ":ifsf=1thensf$="ff"
  161. 992 poke214,23:print"[145]"
  162. 994 print " [[194]]uy         [[211]]ell      [211]ound [[207]]";sf$;"  ";
  163. 996 print" [[198]8] to end       [[210][197][212][213][210][206]] to [195]ontinue";:poke2023,160:poke56295,9
  164. 998 goto 1020
  165. 1000 poke214,23:print"[145]"
  166. 1002 print" [esc] to end                           ";
  167. 1010 rem
  168. 1020 mt=o:return
  169. 1030 rem
  170. 1040 rem
  171. 1050 printtab(20-len(m$)/2)m$: return
  172. 1060 rem
  173. 1070 hx=len(str$(a)):printtab(h-hx-1);:return
  174. 1080 rem
  175. 1090 poke204,0
  176. 1095 getan$:ifan$=""then1095
  177. 1100 ifan$="y"oran$="[217]"thenpoke2040,1:return
  178. 1102 ifan$="n"oran$="[206]"thenpoke2040,1:return
  179. 1104 poke54276,65:poke54276,64:goto1090
  180. 1110 ifasc(an$)=27thenesc=1
  181. 1130 rem
  182. 1140 forzz=1tolen(m$):printtab(38)mid$(m$,zz,1):print"[145] ";:ifsf=1thennext:print:return
  183. 1141 poke54283,129:poke54283,128:forl=1to20:nextl,zz:print:return
  184. 1150 rem
  185. 1160 poke214,19:print:print"[150][201][204][204][197][199][193][204] [197][206][212][210][217] - [212][210][217] [193][199][193][201][206]!";
  186. 1165 poke54276,33:poke54276,32:fort=1to1000:next:return
  187. 1170 rem
  188. 1180 rem
  189. 1190 forl=0tonl:poke